<div class="definewidth m10">
    <button type="button" class="btn btn-success" id="addnew">添加应用</button>
</div>

<div id="nodeWrap">
    <table class="table table-bordered table-hover definewidth m10">
         <foreach name="node" item="app">
             <tr>
                 <td>
                    <p>
                     <strong>{$app.title}</strong>
                     <a href="{:U(GROUP_NAME . '/Rbac/addNode',array('pid'=> $app['id'],'level'=>2))}">[ 添加控制器 ]</a>
                      <a href="{:U(GROUP_NAME . '/Rbac/editNode', array('id' => $app['id']))}">[ 修改 ]</a>
                      <a href="{:U(GROUP_NAME . '/Rbac/delNode', array('nid' => $app['id']))}">[ 删除 ]</a>
                    </p>

                     <foreach name="app.child" item="action">
                         <dl>
                             <dt>
                                 <strong>{$action.title}</strong>
                                 <a href="{:U(GROUP_NAME . '/Rbac/addNode',array('pid'=> $action['id'],'level'=>3))}">[ 添加方法 ]</a>
                                 <a href="{:U(GROUP_NAME . '/Rbac/editNode', array('id' => $action['id']))}">[ 修改 ]</a>
                                 <a href="{:U(GROUP_NAME . '/Rbac/delNode', array('nid' => $action['id']))}">[ 删除 ]</a>
                             </dt>

                             <foreach name="action.child" item="method">
                                 <dd>
                                     <span>{$method.title}</span>
                                     <a href="{:U(GROUP_NAME . '/Rbac/editNode', array('id' => $method['id']))}">[ 修改 ]</a>
                                     <a href="{:U(GROUP_NAME . '/Rbac/delNode', array('nid' => $method['id']))}">[ 删除 ]</a>
                                 </dd>
                             </foreach>
                         </dl>
                     </foreach>
                 </td>
             </tr>
         </foreach>
    </table>
</div>


<script language="JavaScript">
    $(function () {
        $('#addnew').click(function(){
            window.location.href="{:U(GROUP_NAME . '/Rbac/addNode')}";
        });
    });
</script>